ihelpuoo.weboo.runtime.LocaleSet = function()
{
	this.name = null;
	this.text = null;
	this.messages = null;
	
	this.HTML = null;
}

ihelpuoo.weboo.runtime.LocaleSet.prototype
=
{
	valueOf: function(ele)
	{
		this.name = ele.tagName;
		this.text = ele.getAttribute("text");
		var children = ele.getElementsByTagName("msg");
		this.messages = new Array();
		for(var i=0;i<children.length;i++)
		{
			var m = new ihelpuoo.weboo.runtime.Message();
			m.valueOf(children.item(i));
			this.messages.push(m);
		}
	}
	
	,
	render: function()
	{
		if(null == this.HTML)
		{
			this.HTML = new ihelpuoo.weboo.runtime.LocaleSetHTML();
			for(var i=0;i<this.messages.length;i++)
			{
				var m = this.messages[i];
				this.HTML.addMessage(m.key,m.value);
			}
		}
		this.HTML.show();
		return this.HTML.shell;
	}
	
	,
	dump: function()
	{
		return name + "["+this.text+"] with " + this.messages.length + " messages!";
	}
}